<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <title>6-1 transition</title>
    <style>
        .hello {
            width: 100px;
            text-align: center;
        }

        .fade-enter-from, .fade-leave-to {
            opacity: 0;
        }

        .fade-enter-active, .fade-leave-active {
            transition: opacity 5s ease;
        }

        .fade-enter-to {
            opacity: 1;
        }

        @keyframes bounce-in {
            0% {
                transform: scale(0.0);
            }
            50% {
                transform: scale(1.5);
            }
            100% {
                transform: scale(1.0);
            }
        }

        .bounce-enter-active {
            animation: bounce-in 5s;
        }

        .bounce-leave-active {
            animation: bounce-in 5s reverse;
        }

    </style>
</head>
<body>
<div id="app">
    <button @click='show = !show'>toggle</button>
    <transition name='fade'>
        <p v-show='show'>Hello!</p>
    </transition>
    <transition name='bounce'>
        <div v-if='show' class='hello'>Hello!</div>
    </transition>
</div>
<script src="../lib/vue.global.js" type="text/javascript"></script>
<script>
  const { createApp, ref } = Vue
  const vm = createApp({
    setup() {
        const show = ref(true)
        return {
            show
        }
    }
  }).mount('#app')
</script>
</body>
</html>
